#include "../bsp/clk/bsp_clk.h"
#include "../bsp/delay/bsp_delay.h"
#include "../bsp/int/bsp_int.h"
#include "../bsp/led/bsp_led.h"
#include "../bsp/spi/bsp_spi.h"
#include <stdio.h>

/*
 * @description	: main函数
 * @param 		: 无
 * @return 		: 无
 */
int main(void) {

  int_init();      /* 初始化中断(一定要最先调用！) */
  imx6u_clkinit(); /* 初始化系统时钟 			*/
  clk_enable();    /* 使能所有的时钟 			*/
  led_init();      /* 初始化led 			*/
  unsigned char res = 0;
  unsigned char ret = 0;
  SPI_Init(ECSPI3);


  while (1) {
    res %= 256;
    res++;
    ret = SPI_Mode0_SwapByte(ECSPI3, res);
    printf("ret = %d \r\n", ret);
    delay_ms(50);
  }

  return 0;
}
